package bean.validate;

import java.io.Serializable;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;

@ManagedBean(name="uv")
@ViewScoped
public class UserValidate implements Serializable {
	private static final long serialVersionUID = 8048446519596040884L;

	private String form = "form_user";
	// Validation

	private void message(String field){
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "ok");
		FacesContext.getCurrentInstance().addMessage(form + ":" + field, message);
	}

	// Validation
	public void name() {
		this.message("name");
	}

	public void surName() {
		this.message("surname");
	}

	public void email() {
		this.message("email");
	}

	public void birthDate() {
		this.message("birthdate");
	}

	public void gender() {
		this.message("gender");
	}

	public void password() {
		this.message("password");
	}

	public void passwordOld() {
		this.message("password_old");
	}

	public void facebook() {
		this.message("facebook");
	}
	public void google_plus() {
		this.message("google_plus");
	}
	public void twitter() {
		this.message("twitter");
	}

	public void link() {
		this.message("link");
	}

	public void website() {
		this.message("website");
	}


}
